module.exports = function (callback) {


    var _indexedDB = require('./IndexedDB');
    var version= "<%version%>".split('.').join('');
    var info = {
        name: 'webdb',
        tabname: "drive_" +version,
        version: version
    };
    var IndexedDB = new _indexedDB(info)
    callback = callback || function () {};
    this.set = function (row, callback) {
        IndexedDB.deleteDataByKey(info.tabname, row.key, function (off, error) {
            IndexedDB.addData(info.tabname, {
                value: typeof row.value == 'string' ? JSON.parse(row.value) : row.value,
                timedb: new Date().getTime(),
                lms: row.lms,
                key: row.key,
                etag: row.etag
            }, function (row, error) {
                callback()
            })
        })
    };
    this.get = function (key, callback) {
        IndexedDB.getDataByKey(info.tabname, key, function (obj) {
            if (obj) {
                var etag = obj.etag;
                var ldb = obj.value;
                callback(ldb, etag, obj.lms)
            } else {
                callback(null)
            }
        })
    }
    var self = this;
};